
//
//  OKViewController.m
//  yonghu
//
//  Created by 浪尖渝力 on 2018/2/24.
//  Copyright © 2018年 com.DJS. All rights reserved.
//

#import "OKViewController.h"
#import "DocumentViewController.h"
#import "ReleaseAdviceViewController.h"
#import "ReleaseCaseViewController.h"
#import "PersonalityViewController.h"
@interface OKViewController ()
@property(nonatomic,strong)UILabel  *label;

@end

@implementation OKViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    

    self.view.backgroundColor=[UIColor whiteColor];
    UIImageView *imageView=[UIImageView new];
    [self.view addSubview:imageView];
    [imageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.centerY.mas_equalTo(-150);
        make.width.height.mas_equalTo(140);
    }];
    imageView.image=[UIImage imageNamed:@"发布成功"];
    
    _label=[UILabel new];
    [self.view addSubview:_label];
    [_label mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.top.mas_equalTo(imageView.mas_bottom).mas_equalTo(40);
    }];
   
    _label.textColor=ColorWithRGB(49, 49, 49);
    _label.font=[UIFont systemFontOfSize:20];
    
    UILabel *label2=[UILabel new];
    [self.view addSubview:label2];
    [label2 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.width.mas_equalTo(180);
        make.top.mas_equalTo(_label.mas_bottom).mas_equalTo(30);
    }];
    label2.textColor=ColorWithRGB(149, 149, 149);
    label2.font=[UIFont systemFontOfSize:17];
//    label2.text=@"我们将尽快为您安排律师服务，请耐心等待!";
    label2.textAlignment=NSTextAlignmentCenter;
    label2.numberOfLines=0;
    
    UIButton *btn1=[UIButton new];
    [self.view addSubview:btn1];
    [btn1 mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerX.mas_equalTo(0);
        make.bottom.mas_equalTo(-120);
        make.width.mas_equalTo(120);
        make.height.mas_equalTo(40);
    }];
    btn1.layer.cornerRadius=3;
    [btn1 setTitle:@"查看详情" forState:0];
    [btn1 setTitleColor:[UIColor whiteColor] forState:0];
    btn1.backgroundColor=_backgroundColor;
    [btn1 addTarget:self action:@selector(pushToXiangQing) forControlEvents:UIControlEventTouchUpInside];
    
//
//    UIButton *btn2=[UIButton new];
//    [self.view addSubview:btn2];
//    [btn2 mas_makeConstraints:^(MASConstraintMaker *make) {
//        make.left.mas_equalTo(_mainW/2+20);
//        make.bottom.mas_equalTo(-120);
//        make.width.mas_equalTo(120);
//        make.height.mas_equalTo(40);
//    }];
//    btn2.layer.cornerRadius=3;
//    [btn2 setTitle:@"返回首页" forState:0];
//    [btn2 setTitleColor:[UIColor whiteColor] forState:0];
//    btn2.backgroundColor=ColorWithRGB(94, 148, 171);
//    [btn2 addTarget:self action:@selector(popVc) forControlEvents:UIControlEventTouchUpInside];
    NSString *neiXing=[_dic objectForKey:@"neixin"];
    if ([neiXing isEqualToString:@"代写文书"]) {
        self.navigationItem.title=@"支付成功";
    }if ([neiXing isEqualToString:@"个性服务"]) {
        self.navigationItem.title=@"支付成功";
    }if ([neiXing isEqualToString:@"免费咨询"]) {
        self.navigationItem.title=@"发布成功";
    }if ([neiXing isEqualToString:@"发布案件"]) {
        self.navigationItem.title=@"发布成功";
    }
    _label.text=self.navigationItem.title;
}

-(void)pushToXiangQing{
    NSString *neiXing=[_dic objectForKey:@"neixin"];
    if ([neiXing isEqualToString:@"代写文书"]) {
         self.navigationItem.title=@"支付成功";
        DocumentViewController *document=[DocumentViewController new];
        document.dic=_dic;
        document.abc=1;
        [ZQTools pushNextViewController:self andRootController:document];
    }if ([neiXing isEqualToString:@"个性服务"]) {
         self.navigationItem.title=@"支付成功";
        PersonalityViewController *document=[PersonalityViewController new];
        document.dic=_dic;
        document.abc=1;
        [ZQTools pushNextViewController:self andRootController:document];
    }if ([neiXing isEqualToString:@"免费咨询"]) {
         self.navigationItem.title=@"发布成功";
        ReleaseAdviceViewController *law=[[ReleaseAdviceViewController alloc] init];
        law.dic=_dic;
        law.abc=1;
        [ZQTools pushNextViewController:self andRootController:law];
        
    }
    if ([neiXing isEqualToString:@"发布案件"]) {
         self.navigationItem.title=@"发布成功";
        ReleaseCaseViewController *document=[ReleaseCaseViewController new];
        document.dic=_dic;
        document.abc=1;
        [ZQTools pushNextViewController:self andRootController:document];
    }
     _label.text=self.navigationItem.title;
    
}

-(void)popVc{
    [self.navigationController popToRootViewControllerAnimated:YES];
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
